@using Seal.Model
@using Seal.Helpers
@{
    Report report = Model;
    ReportView view = report.CurrentView;
    Repository repository = report.Repository;
}

<script>
    $(function () {
        $('#tc_@(view.ViewId) li:eq(@view.GetNumericValue("tab_selected_index")) a').tab('show');
        $('#tc_@(view.ViewId) a').click(function (e) {
            submitViewParameter("@view.ViewId", "tab_selected_index", $($(this).attr('href')).index());
            @if (report.HasNVD3Chart)
            {<text>
                    //redraw nvd3 charts
                    setTimeout(function () { nvd3UpdateCharts(); }, 200);
            </text>
            }
            setTimeout(function () { //redraw dt
                $($.fn.dataTable.tables(true)).DataTable().columns.adjust().responsive.recalc();
            }, 200);
        });
    });
</script>

@if (!report.PrintLayout && view.GetValue("tab_position") == "right")
{
    <div class="row">
        <div class="tab-content col-md-@(12-view.GetNumericValue("tab_menu_width"))">
            @Include(view.GetPartialTemplateKey("TabControl.iContent", view), view)
        </div>
        <div class="col-md-@view.GetNumericValue("tab_menu_width")">
            @Include(view.GetPartialTemplateKey("TabControl.iMenu", view), view)
        </div>
    </div>
}
else if (!report.PrintLayout && view.GetValue("tab_position") == "left")
{
    <div class="row">
        <div class="col-md-@view.GetNumericValue("tab_menu_width")">
            @Include(view.GetPartialTemplateKey("TabControl.iMenu", view), view)
        </div>
        <div class="tab-content col-md-@(12-view.GetNumericValue("tab_menu_width"))">
            @Include(view.GetPartialTemplateKey("TabControl.iContent", view), view)
        </div>
    </div>
}
else
{
    @Include(view.GetPartialTemplateKey("TabControl.iMenu", view), view)
    <div class="tab-content">
        @Include(view.GetPartialTemplateKey("TabControl.iContent", view), view)
    </div>
}
<!--_tab_control-->
